<template>
    <div>
        <div class="app">
            <div class="app_right" v-for="item in coupon" :key="item.id">
                <div class="app_right_top">
                    <span class="app_right_top_text">{{item.status|statustype}}</span>
                </div>
                <span class="app_right_content">{{item.introduction}}</span>
                <div class="app_right_botton">
                    <span class="app_right_botton_title"> 领取优惠券</span>
                </div>
            </div>
            <noData v-if="coupon.length===0"></noData>
        </div>
    </div>
</template>
<script>
import { list } from "@/api/coupon";
import noData from '../product/components/noData'
export default {
    data() {
        return {
            coupon: [],
        };
    },
    filters: {
        statustype(val) {
            if (val == 0) {
                return "满减券";
            } else if (val == 1) {
                return "折扣券";
            } else if (val == 2) {
                return "兑换券";
            }
        },
    },
    components:{
        noData
    },
    created() {
        this.conpunlist();
    },
    methods: {
        conpunlist() {
            list().then((res) => {
                // this.coupon = res.data.data;
            });
        },
    },
};
</script>
 <style>
.app {
    display: flex;
    background-color: rgb(248, 248, 248);
    width: 363px;
    overflow-x: auto;
    padding-left: 10px;
    box-sizing: border-box;
}

.app_right {
    width: 100px;
    background-color: #ffffff;
    border-radius: 5px;
    flex-shrink: 0;
    margin-right: 10px;
}

.app_right:last-child{
    width: 100px;
    background-color: #ffffff;
    border-radius: 5px;
    flex-shrink: 0;
    margin-right: 0px;
}

.app_right_top {
    width: 80%;
    display: flex;
    justify-content: center;
    background-color: rgb(254, 222, 181);
    display: flex;
    justify-content: center;
    border-radius: 0 0 5px 5px;
    margin: 0 auto;
    padding-top: 6px;
    padding-bottom: 5px;
}
.app_right_top_text {
    font-size: 12px;
}
.app_right_content {
    height: 20px;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    color: rgb(223, 88, 88);
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.app_right_botton {
    margin: 10px auto;
    width: 80%;
    background-color: rgb(223, 88, 88);
    display: flex;
    justify-content: center;
    border-radius: 100px;
    padding-top: 6px;
    padding-bottom: 5px;

}

.app_right_botton_title {
    color: #fff;
    font-size: 12px;
}
</style>

